import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import detail from "../testing/detail";
import total from "../testing/total";
import addressmanage from "../testing/addressmanage";
import addAddress from "../testing/addAddress";
import addressRevise from "../testing/addressRevise";
import goodsAction from "../testing/goodsAction";
import Market from "../views/Market";
import list from "../testing/v-list";
import shoppingcard from "../testing/shoppingcard";
import Focus from "../views/focus.vue"

Vue.use(VueRouter);

const routes = [
  {
    path: "/market",
    name: "Market",
    component: Market,
  },
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  
  {
    path: "/focus",
    name: "Focus",
    component: Focus,
  },
  // {
  //   path: "/home",
  //   name: "Home",
  //   component: Home,
  // },
  // 测试
  {
    path: "/goodsAction",
    name: "goodsAction",
    component: goodsAction,
  },
   // 测试
   {
    path: "/shoppingcard",
    name: "shoppingcard",
    component: shoppingcard,
  },
  {
    // 测试
    path: "/list",
    name: "a",
    component: list,
  },
  {
    path: "/addressRevise",
    component: addressRevise,
  },
  {
    path: "/addAddress",
    name: "addAddress",
    component: addAddress,
  },
  {
    path: "/addressmanage",
    name: "addressmanage",
    component: addressmanage,
  },
  {
    path: "/total",
    name: "total",
    component: total,
  },
  {
    path: "/detail",
    name: "detail",
    component: detail,
  },
  {
    path: "/recipe",
    name: "Recipe",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Recipe.vue"),
  },
  {
    path: "/dynamicDetails",
    name: "DynamicDetails",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/DynamicDetails.vue"),
  },
  {
    path: "/personal",
    name: "Personal",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Personal.vue"),
  },
  {
    path: "/AddCongee",
    name: "addCongee",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/AddCongee.vue"),
  },
  {
    path: "/login",
    name: "Login",
    component: () =>
      import(/* webpackChunkName: "Login" */ "../views/Login.vue"),
    children: [
      {
        path: "account",
        name: "Account",
        component: () =>
          import(/* webpackChunkName: "Account" */ "../views/Account.vue"),
      },
      {
        path: "phone",
        name: "Phone",
        component: () =>
          import(/* webpackChunkName: "Phone" */ "../views/Phone.vue"),
      },
    ],
  },
  {
    path: "/register",
    name: "Register",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Register" */ "../views/Register.vue"),
  },
  {
    path: "/me",
    name: "Me",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "Me" */ "../views/Me.vue"),
  },
  {
    path: "/collect",
    name: "Collect",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Collect" */ "../views/Collect.vue"),
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
